package org.liveboardgames.agricola.control.events
{
    import com.adobe.cairngorm.control.CairngormEvent;
    
    import org.liveboardgames.agricola.vo.common.IResourceContainer;
    import org.liveboardgames.common.dictionary.collections.HashCollection;
    import org.liveboardgames.common.dictionary.collections.IMap;
    
    public class ResourceEvent extends CairngormEvent
    {
        public var resourceHost:IResourceContainer;
        
        public var resources:IMap;
        
        public function ResourceEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false)
        {
            super(type, bubbles, cancelable);
        }
        
        public function getResourceAsMap(resourceType:String, quantity:int):HashCollection
        {
            var resourceAsMap:HashCollection = null;
            
            if (quantity > 0 && resourceType != null)
            {
                resourceAsMap = new HashCollection();
                resourceAsMap.put(resourceType, quantity);
            }
            
            return resourceAsMap;
        }
    
    }
}